class Solution {//面试题01.02——判定是否为数组重排
public:
    bool CheckPermutation(string s1, string s2) {
        if(s2.size()!=s1.size()) return false;
        int hash[26]={0};
        for(auto ch:s1) hash[ch-'a']++;

        for(auto ch:s2){
            hash[ch-'a']--;
            if(hash[ch-'a']<0) return false;
        }

        return true;
    }
};